Unit BDojoTemplateUnit;

{$mode objfpc}{$H+}

Interface

ResourceString

  DOJO_TEMPLATE =
    '<!doctype html>' +
    '<html lang="en">' +
      '<head>' +
        '<meta charset="utf-8">' +
        '<title>%5:s</title>' +
    {$IFNDEF RELEASE}
        '<script>' +
            'dojoConfig = {' +
                'has: {' +
                    '"dojo-firebug": true,' +
                    '"dojo-debug-messages": true' +
                '}' +
            '};' +
        '</script>' +
    {$ENDIF}
        '<style>' +
          {$IFNDEF RELEASE}
          '* {' +
            'outline: none;' +
          '}' +
          {$ENDIF}
          'html, body {' +
            'width: 100%0:s;' +
            'height: 100%0:s;' +
            'margin: 0px;' +
          '}' +
        '</style>' +
        '<link rel="stylesheet" href="%7:s/dijit/themes/%6:s/%6:s.css">' +
        '<script src="%7:s/dojo/dojo.js"></script>' +
      '</head>' +
      '<body class="%6:s">' +
      '</body>' +
    '<script>' +
      'function loadCSS(cssFiles){' +
        'if (!document.dynamicCSS){' +
          'document.dynamicCSS = [];' +
        '}' +
        'var i,link;' +
        'for (i=0;i<cssFiles.length;i+=1){' +
          'document.dynamicCSS.push(cssFiles[i]);' +
          'link=document.createElement("link");' +
          'link.setAttribute("rel", "stylesheet");' +
          'link.setAttribute("type", "text/css");' +
          'link.setAttribute("href", cssFiles[i]);' +
          'document.getElementsByTagName("head")[0].appendChild(link);' +
        '}'+
      '}' +
      '%1:s' +
      'loadCSS([%2:s]);' +
      'dojo.ready(function(){' +
        '%3:s' +
        '%4:s' +
      '});' +
    '</script>' +
    '</html>';

Implementation

End.

